package com.tanhua.model.vo;

import com.tanhua.model.db.Options;
import com.tanhua.model.db.Questions;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class QuestionsVo {

    private String id;
    private String question;
    private List<OptionsVo> options;

    public static QuestionsVo init(Questions questions,List<OptionsVo> options){
        QuestionsVo vo = new QuestionsVo();
        vo.setId(questions.getId().toString());
        vo.setQuestion(questions.getQuestion());
        vo.setOptions(options);
        return vo;
    }
}
